package com.heima.admin.controller;

import com.heima.admin.dto.LoginDto;
import com.heima.admin.service.IAdUserService;
import com.heima.common.dto.ResponseResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/login")
public class LoginController {

    @Autowired
    IAdUserService userService;

    /**
     * admin端的登录
     * @param dto
     * @return
     */
    @PostMapping("/in")
    public ResponseResult login(@RequestBody LoginDto dto){
        // 调用service 完成复杂功能
        return userService.login(dto);
    }
}
